﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Script.Services;
using syc.js.autocomplete;

namespace syc.js.autocomplete
{
    /// <summary>
    /// data 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。
    // [System.Web.Script.Services.ScriptService]
    public class data : System.Web.Services.WebService
    {

        [WebMethod]
        [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
        public List<备品备件> GetCustomers(string q, int limit)
        {
            List<备品备件> names=new List<备品备件>();
            using (testDataContext db = new testDataContext()) {
                names = db.备品备件.ToList();            
            }
            return names;
        }  
    }
}
